<template>
    <div v-if="result">
        <Header>商品详情</Header>
        <ProductSwiper :item="result" ></ProductSwiper>
        <ProductInformation :item="result" ></ProductInformation>
        <ProductBuy :proid="result.proid" ></ProductBuy>
    </div>
</template>
<script lang='ts' setup>
import { ref, onMounted } from 'vue';
import { getProduct } from '@/service/api'
import Header from '@/components/Header.vue';
import ProductSwiper from '@/components/ProductSwiper.vue';
import ProductBuy from '@/components/ProductBuy.vue';
import ProductInformation from '@/components/ProductInformation.vue';
import { useRoute } from 'vue-router';
type TimeList = {
    banners: string[],
    desc: string,
    originprice: number,
    category: string,
    brand: string,
    proname: string,
    proid: string,
    img1: string
}
const result = ref<TimeList>();
onMounted(async () => {
    result.value = (await getProduct((useRoute().params.id) as string)).data.data;
})
</script>
<style lang='less' scoped>

</style>